package com.sprite3d.shooter3d;

import com.game.helper.PhysicsSystem;
import com.game.obj.GameObject;
import com.math3d.PolygonGroup;

public class ShooterPlayer3d extends GameObject{
	private static final float BULLET_HEIGHT = 75;
    public static final float DEFAULT_PLAYER_RADIUS = 32;
    public static final float DEFAULT_PLAYER_HEIGHT = 128;
    private static final float DEFAULT_MAX_HEALTH = 100;
    private float jumpHeight;
	public ShooterPlayer3d(PolygonGroup polygonGroup) {
		super(polygonGroup);
		// TODO Auto-generated constructor stub
		jumpHeight = PhysicsSystem.getInstance().getJumpVelocity(DEFAULT_MAX_HEALTH);
	}
	@Override
	public void setJumping(boolean b) {
		// TODO Auto-generated method stub
		if(b != isJumping){
			super.setJumping(b);
			if(isJumping){
				PhysicsSystem.getInstance().jump(this, jumpHeight);
			}
		}
	}
	@Override
	public void notifyFloorCollision() {
		// TODO Auto-generated method stub
		super.notifyFloorCollision();
		setJumping(false);
	}
}
